package com.gather.treemaps;

import java.util.TreeMap;

public class Example01 {
    public static void main(String[] args) {
        System.out.println("TreeMap学习");
        TreeMap<String, Integer> stringIntegerTreeMap = new TreeMap<>();
        // 添加 "apple"、"pear"、"orange"
        stringIntegerTreeMap.put("apple",100);
        stringIntegerTreeMap.put("pear",200);
        stringIntegerTreeMap.put("orange",300);
        System.out.println(stringIntegerTreeMap); // {apple=100, orange=300, pear=200}
    }
}
